package com.bow.algorithm.leetcode;

import java.util.concurrent.locks.ReentrantLock;

public class AQSTest {

    public static void main(String[] args) {
        ReentrantLock lock = new ReentrantLock();

        Thread t = new Thread(new Runnable() {
            @Override
            public void run() {
                lock.lock();
                try {
                    Thread.sleep(3000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        t.start();

        lock.lock();
        int a = 0;
        a++;
        lock.unlock();
        System.out.println("+++");
        lock.unlock();
    }
}
